About: "Extends ArcView to support NITF images (v3.1)."
LoadScript: 3
CanUnloadScript: 4
UnloadScript: 5
ExtVersion: 3100
)
(Script.2
Name: "NITF.ObjectsPresent"
SourceCode: "'''''''''''''''''''''''\n' NITF.ObjectsPresent '\n'''''''''''''''''''''''\ntheProject = av.GetProject\nif (theProject = NIL) then\n return FALSE\nend\n\nfor each e in Clipboard.The\n if (e.Is(ITheme)) then\n theImgSrc = e.GetImgSrc\n theSrcName = theImgSrc.GetSrcName\n if (ImgCat.IsValidFileName(theSrcName.GetFileName)) then\n if (theImgSrc.ContainType(ISrc.ReturnTypeFromFileExt(\"ntf\"))) then\n return TRUE\n end\n else\n if (theImgSrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"ntf\")) then\n
return TRUE\n end\n end\n elseif (e.Is(ViewFrame) and e.IsFilled) then\n for each aTheme in e.GetView.GetThemes\n if (aTheme.Is(ITheme)) then\n theImgSrc = aTheme.GetImgSrc\n theSrcName = theImgSrc.GetSrcName\n if (ImgCat.IsValidFileName(theSrcName.GetFileName)) then\n if (theImgSrc.ContainType(ISrc.ReturnTypeFromFileExt(\"ntf\"))) then\n return TRUE\n end\n else\n if (theImgSrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"ntf\")) then\n
return TRUE\n end\n end\n end\n end\n elseif (e.Is(PictureFrame) and e.IsFilled and e.IsFilledBy(FileName)) then\n theFillObj = e.GetFillObject\n if (ISrc.IsValidFileName(theFillObj)) then\n theISrc = ISrc.Make(SrcName.Make(theFillObj.AsString))\n if (theISrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"ntf\")) then\n return TRUE\n end\n end\n end\nend\ntheDocs = av.GetProject.GetDocs\nfor each aDoc in theDocs\n if (aDoc.Is(View)) then\n for each aTheme in aDo
c.GetThemes\n if (aTheme.Is(ITheme)) then\n theImgSrc = aTheme.GetImgSrc\n theSrcName = theImgSrc.GetSrcName\n if (ImgCat.IsValidFileName(theSrcName.GetFileName)) then\n if (theImgSrc.ContainType(ISrc.ReturnTypeFromFileExt(\"ntf\"))) then\n return TRUE\n end\n else\n if (theImgSrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"ntf\")) then\n return TRUE\n end\n end\n end\n end\n elseif (aDoc.Is(Layout)) then\n for each aGra
phic in aDoc.GetGraphics\n if (aGraphic.Is(PictureFrame) and aGraphic.IsFilled and aGraphic.IsFilledBy(FileName)) then\n theFillObj = aGraphic.GetFillObject\n if (ISrc.IsValidFileName(theFillObj)) then\n theISrc = ISrc.Make(SrcName.Make(theFillObj.AsString))\n if (theISrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"ntf\")) then\n return TRUE\n end\n end\n elseif (aGraphic.Is(ViewFrame) and aGraphic.IsFilled) then\n for each aTheme in aGraphic.Get
View.GetThemes\n if (aTheme.Is(ITheme)) then\n theImgSrc = aTheme.GetImgSrc\n theSrcName = theImgSrc.GetSrcName\n if (ImgCat.IsValidFileName(theSrcName.GetFileName)) then\n if (theImgSrc.ContainType(ISrc.ReturnTypeFromFileExt(\"ntf\"))) then\n return TRUE\n end\n else\n if (theImgSrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"ntf\")) then\n return TRUE\n end\n end\n end\n
end\n end\n end\n end\nend\n\nreturn FALSE"
)
(Script.3
Name: "NITF.Load"
SourceCode: "''''''''''''''''\n' NITF.Load '\n''''''''''''''''\n' Add .ntf to the ISrc extension list\nextn_list = ISrc.ReturnExtensions\nextn_list = extn_list.Add(\"ntf\".AsString)\nISrc.SetExtensions(extn_list)\n"
)
(Script.4
Name: "NITF.CanUnload"
SourceCode: "'''''''''''''''''\n'NITF.CanUnload '\n'''''''''''''''''\n' Run script NITF.ObjectsPresent to see if there is any ImgSrc in any View with a .ntf extension.\n' Return result to boolean variable.\nobjectsPresent = av.Run(\"NITF.ObjectsPresent\", NIL)\n\n' If objectsPresent is TRUE the dll should not be unloaded\nreturn objectsPresent.Not\n"
)
(Script.5
Name: "NITF.Unload"
SourceCode: "''''''''''''''''''\n' NITF.Unload '\n''''''''''''''''''\n' Remove .ntf to the ISrc extension list\nextn_list = ISrc.ReturnExtensions\nntfIndex = extn_list.FindByValue(\"ntf\")\nif (ntfIndex = -1) then \n return NIL\nend\nextn_list.Remove(ntfIndex)\nISrc.SetExtensions(extn_list)\n"